home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / gridex / frmsumma.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-01-03  |  6.0 KB  |  209 lines

  1. VERSION 5.00
  2. Begin VB.Form frmSummary 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "View Summary"
  5.    ClientHeight    =   3090
  6.    ClientLeft      =   1620
  7.    ClientTop       =   2235
  8.    ClientWidth     =   6090
  9.    BeginProperty Font 
  10.       Name            =   "Tahoma"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   400
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    Icon            =   "frmSummary.frx":0000
  19.    LinkTopic       =   "Form1"
  20.    MaxButton       =   0   'False
  21.    MinButton       =   0   'False
  22.    ScaleHeight     =   3090
  23.    ScaleWidth      =   6090
  24.    ShowInTaskbar   =   0   'False
  25.    StartUpPosition =   2  'CenterScreen
  26.    Begin VB.CommandButton cmdOK 
  27.       Caption         =   "OK"
  28.       Height          =   345
  29.       Left            =   2235
  30.       TabIndex        =   1
  31.       Top             =   2655
  32.       Width           =   1245
  33.    End
  34.    Begin VB.Frame Frame1 
  35.       Caption         =   "Description"
  36.       Height          =   2475
  37.       Left            =   180
  38.       TabIndex        =   0
  39.       Top             =   90
  40.       Width           =   5760
  41.       Begin VB.CommandButton cmdFormat 
  42.          Caption         =   "Format..."
  43.          Height          =   345
  44.          Left            =   165
  45.          TabIndex        =   5
  46.          Top             =   1980
  47.          Width           =   1245
  48.       End
  49.       Begin VB.CommandButton cmdSort 
  50.          Caption         =   "Sort..."
  51.          Height          =   345
  52.          Left            =   165
  53.          TabIndex        =   4
  54.          Top             =   1455
  55.          Width           =   1245
  56.       End
  57.       Begin VB.CommandButton cmdGroup 
  58.          Caption         =   "Group By..."
  59.          Height          =   345
  60.          Left            =   165
  61.          TabIndex        =   3
  62.          Top             =   930
  63.          Width           =   1245
  64.       End
  65.       Begin VB.CommandButton cmdFields 
  66.          Caption         =   "Fields..."
  67.          Height          =   345
  68.          Left            =   165
  69.          TabIndex        =   2
  70.          Top             =   405
  71.          Width           =   1245
  72.       End
  73.       Begin VB.Label lblSort 
  74.          BackStyle       =   0  'Transparent
  75.          Height          =   390
  76.          Left            =   1500
  77.          TabIndex        =   9
  78.          Top             =   1455
  79.          Width           =   4170
  80.          WordWrap        =   -1  'True
  81.       End
  82.       Begin VB.Label lblGroups 
  83.          BackStyle       =   0  'Transparent
  84.          Height          =   390
  85.          Left            =   1500
  86.          TabIndex        =   8
  87.          Top             =   930
  88.          Width           =   4170
  89.          WordWrap        =   -1  'True
  90.       End
  91.       Begin VB.Label lblFields 
  92.          BackStyle       =   0  'Transparent
  93.          Height          =   390
  94.          Left            =   1500
  95.          TabIndex        =   7
  96.          Top             =   405
  97.          Width           =   4170
  98.          WordWrap        =   -1  'True
  99.       End
  100.       Begin VB.Label lblformat 
  101.          Caption         =   "Fonts and other Table View settings"
  102.          Height          =   390
  103.          Left            =   1500
  104.          TabIndex        =   6
  105.          Top             =   1980
  106.          Width           =   4170
  107.       End
  108.    End
  109. Attribute VB_Name = "frmSummary"
  110. Attribute VB_GlobalNameSpace = False
  111. Attribute VB_Creatable = False
  112. Attribute VB_PredeclaredId = True
  113. Attribute VB_Exposed = False
  114. Option Explicit
  115. Dim m_GridEX As GridEX
  116. Private Sub cmdFields_Click()
  117.     If frmShowfields.ShowFields(m_GridEX) Then
  118.         LoadFieldNames
  119.     End If
  120. End Sub
  121. Private Sub cmdFormat_Click()
  122.     If m_GridEX.View = jgexTable Then
  123.         frmTableview.FormatGrid m_GridEX
  124.     Else
  125.         frmCardView.FormatGrid m_GridEX
  126.     End If
  127. End Sub
  128. Private Sub cmdGroup_Click()
  129.     frmGroupBy.GroupGrid m_GridEX
  130.     LoadGroupNames
  131. End Sub
  132. Private Sub cmdOK_Click()
  133.     Hide
  134. End Sub
  135. Private Sub cmdSort_Click()
  136.     frmSort.SortGrid m_GridEX
  137.     LoadSortNames
  138. End Sub
  139. Public Sub ShowSummary(gr As GridEX)
  140. Dim strTemp As String
  141.     Set m_GridEX = gr
  142.     LoadFieldNames
  143.     LoadGroupNames
  144.     LoadSortNames
  145.     strTemp = "Fonts and other "
  146.     If gr.View = jgexCard Then
  147.         strTemp = strTemp & "Card"
  148.         cmdGroup.Enabled = False
  149.     Else
  150.         strTemp = strTemp & "Table"
  151.     End If
  152.     strTemp = strTemp & " View settings"
  153.     lblformat = strTemp
  154.     Show 1
  155.     Set m_GridEX = Nothing
  156.     Unload Me
  157. End Sub
  158. Private Sub LoadFieldNames()
  159. Dim strTemp As String
  160. Dim c As Column
  161.     For Each c In m_GridEX.Columns
  162.         If c.Visible Then
  163.             strTemp = strTemp & c.Tag & ", "
  164.         End If
  165.     Next
  166.     strTemp = Left(strTemp, Len(strTemp) - 2)
  167.     lblFields = strTemp
  168. End Sub
  169. Private Sub LoadGroupNames()
  170. Dim strTemp As String
  171. Dim c As Column
  172. Dim gr As JSGridEX.Group
  173.     For Each gr In m_GridEX.Groups
  174.         Set c = m_GridEX.Columns(gr.ColIndex)
  175.         strTemp = strTemp & c.Tag
  176.         If gr.SortOrder = jgexSortAscending Then
  177.             strTemp = strTemp & " (ascending), "
  178.         Else
  179.             strTemp = strTemp & " (descending), "
  180.         End If
  181.     Next
  182.     If strTemp = "" Then
  183.         strTemp = "None"
  184.     Else
  185.         strTemp = Left(strTemp, Len(strTemp) - 2)
  186.     End If
  187.     lblGroups = strTemp
  188. End Sub
  189. Private Sub LoadSortNames()
  190. Dim strTemp As String
  191. Dim c As Column
  192. Dim sk As JSGridEX.SortKey
  193.     For Each sk In m_GridEX.SortKeys
  194.         Set c = m_GridEX.Columns(sk.ColIndex)
  195.         strTemp = strTemp & c.Tag
  196.         If sk.SortOrder = jgexSortAscending Then
  197.             strTemp = strTemp & " (ascending), "
  198.         Else
  199.             strTemp = strTemp & " (descending), "
  200.         End If
  201.     Next
  202.     If strTemp = "" Then
  203.         strTemp = "None"
  204.     Else
  205.         strTemp = Left(strTemp, Len(strTemp) - 2)
  206.     End If
  207.     lblSort = strTemp
  208. End Sub
  209.